﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using HRM.Helper;

namespace HRM.Converter
{
    public class ConvertStatusTypeToBitmap : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            StatusType type = (StatusType)value;
            switch (type)
            {
                case StatusType.Done:
                    return new BitmapImage(new Uri("/Assets/Icons/done.png", UriKind.Relative));
                case StatusType.Ban:
                    return new BitmapImage(new Uri("/Assets/Icons/bane.png", UriKind.Relative));
                case StatusType.Error:
                    return new BitmapImage(new Uri("/Assets/Icons/error.png", UriKind.Relative));
                default:
                    return new BitmapImage(new Uri("/Assets/Icons/warning.png", UriKind.Relative));
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
